import http from './http'

// 首页 //这边轮播数据为空 所以暂不使用
// export function getHome(){
//     return http.get('/banner')
// }
export function kinds() {
  return http.get('/nav')
}

//首页数据
export function appIndex() {
  return http.get('/recommend/appIndex')
}
//课程请求
export function getClass() {
  return http.get('teacher/search/attrs?page=1&limit=10&')
}
export function getTeacDetail(id) {
  return http.get('/teacher/' + id+'?' )
}
export function getTeacDetailinfo() {
  return http.get('/teacher/mainCourse')
}

export function getNewsNav() {
  return http.get('/information/classify')
}

//获取短信
export function sendSMS(obj) {
  return http.post('/smsCode', obj)
}

export function getYuekeList() {
  return http.get('/book/list/0?page=1&limit=10&order=id&')
}

export function getNewsCard() {
  return http.post('/information/index')
}

export function getYuekeHead() {
  return http.get('/book/classify?')
}

//登录
export function Login(obj) {
  return http.post('/login', obj)
}
//修改密码
export function getPass(obj) {
    return http.post('/password', obj)
}
export function getInfo() {
  return http.get('/userInfo')
}

export function getNewsDetail(id) {

    return http.post('/information/detail?information_id=' + id)
}
// 搜索
export function getcourseBasis(title) {
  return http.get('/courseBasis?keywords='+title)
}

// 排序
export function getcourseBasisa(obj) {
    return http.get('/courseBasis?page=1&limit=10&course_type='+obj.course_type+'&order_by='+obj.order_by+'&is_vip=0&',obj)
}

// 筛选
export function getOther(){
  return http.get('/courseClassify?')
}
export function getClassDetail() {
    return http.get('/courseBasis')
}

export function getYekeHeadlist(index) {
  return http.get('/book/list/' + index + '?page=1&limit=10&order=id&')
}
export function getYekeHot(){
    return http.get('/book/list/0?page=1&limit=10&order=hot&sort=asc&')
}
export function getYekeTime(){
    return http.get('/book/list/0?page=1&limit=10&order=id&sort=asc&')
}

export function getYuekeDetail(id) {
    return http.get('/book/detail/' + id)
}
export function getYuekeSorts() {
    return http.get('/book/list/0?page=1&limit=10&order=price&sort=asc&')
}
export function getYuekeSortj() {
    return http.get('/book/list/0?page=1&limit=10&order=price&sort=desc&')
}
//## 更新用户资料
//###更新用户资料
export function user(data){
    return http.put('/user',data)
}
//### 修改头像api/img
export function getImg(file){
    return http.post('/public/img',file)
}
